package com.zj.guava.eventbus;

import com.google.common.eventbus.Subscribe;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.time.Instant;


public class SimpleListener extends AbstactListener {
    private static final Logger logger = LoggerFactory.getLogger(SimpleListener.class);


    @Subscribe
    public void SimdoAction(String event) {
        try {
            Thread.sleep(3000);
            logger.info("SimpleListener process event:{},time:{}", event, Instant.now());

        } catch (InterruptedException e) {
            e.printStackTrace();
        }

    }

    @Subscribe
    public void SimdoAction2(Integer event) {
        int t = 1 / 0;
        try {
            Thread.sleep(1000);
            logger.info("SimpleListener process2 event:{},time:{}", event, Instant.now());

        } catch (InterruptedException e) {
            e.printStackTrace();
        }

    }

    @Subscribe
    public void SimdoAction3(String event) {
        try {
            Thread.sleep(1000);
            logger.info("SimpleListener process3 event:{},time:{}", event, Instant.now());

        } catch (InterruptedException e) {
            e.printStackTrace();
        }

    }


}
